//app.js

const jpress = require('./utils/jpress.js')


App({
  onLaunch: function () {

   //jpress 初始化
   jpress.init({
     host: 'http://127.0.0.1:8080',
     //  app_id:'wx9d0152b1042f4921',
     //  app_secret:'8365b4f175954a2d31d42ba83fe8482e'
     app_id: 'testAppId0123456789',
     app_secret: 'testAppId0123456789'
   }) 

    jpress.getAppName()
      .then(data => {
        if (data.value) {
          this.globalData.appName = data.value;
        }
      })


    jpress.getCopyright()
      .then(data => {
        if (data.value) {
          this.globalData.copyright = data.value
        }
      })

  },

  globalData: {
    appName: '',
    copyright:'Copyright © 2008-2013 Designed by happy_bobo.'
  }
})